package com.wpr.shop.modules.user.service.impl;

import com.wpr.shop.modules.global.vo.CommonResp;
import com.wpr.shop.modules.user.repository.UserRepository;
import com.wpr.shop.modules.user.service.IUserService;
import com.wpr.shop.modules.user.vo.UserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.invoke.MethodHandles;

/**
 * describe:
 *
 * @author zhanglisheng
 * @date 2018/10/25
 */
@Service
public class UserService implements IUserService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

    @Autowired
    private UserRepository userRepository;

    @Override
    public CommonResp<UserVo> findByUserId(long id) {
        CommonResp<UserVo> commonResp = new CommonResp<UserVo>();
        commonResp.setData(userRepository.findById(id));

        LOGGER.info("日志测试");
        return commonResp;
    }
}
